package com.firebird.app.fejpsl.mvp.model.bean

import com.squareup.moshi.Json
import org.litepal.crud.LitePalSupport
import java.io.Serializable

/**
 * Created by firebird on 2018/4/21.
 */

data class HttpResult<T>(
        @Json(name = "data") val data: T
) : BaseBean()

// 通用的带有列表数据的实体
data class BaseListResponseBody<T>(
        @Json(name = "curPage") val curPage: Int,
        @Json(name = "datas") val datas: List<T>,
        @Json(name = "offset") val offset: Int,
        @Json(name = "over") val over: Boolean,
        @Json(name = "pageCount") val pageCount: Int,
        @Json(name = "size") val size: Int,
        @Json(name = "total") val total: Int
)

//文章
data class ArticleResponseBody(
        @Json(name = "curPage") val curPage: Int,
        @Json(name = "datas") var datas: MutableList<Article>,
        @Json(name = "offset") val offset: Int,
        @Json(name = "over") val over: Boolean,
        @Json(name = "pageCount") val pageCount: Int,
        @Json(name = "size") val size: Int,
        @Json(name = "total") val total: Int
)

//文章
data class Article(
        @Json(name = "apk_link") val apk_link: String,
        @Json(name = "audit") val audit: Int,
        @Json(name = "author") val author: String,
        @Json(name = "chapter_id") val chapter_id: Int,
        @Json(name = "chapter_name") val chapter_name: String,
        @Json(name = "item_collect") var item_collect: Boolean,
        @Json(name = "course_id") val course_id: Int,
        @Json(name = "item_desc") val item_desc: String,
        @Json(name = "envelope_pic") val envelope_pic: String,
        @Json(name = "fresh") val fresh: Boolean,
        @Json(name = "id") val id: Int,
        @Json(name = "item_link") val item_link: String,
        @Json(name = "nice_date") val nice_date: String,
        @Json(name = "nice_share_date") val nice_share_date: String,
        @Json(name = "origin") val origin: String,
        @Json(name = "prefix") val prefix: String,
        @Json(name = "project_link") val project_link: String,
        @Json(name = "publish_time") val publish_time: Long,
        @Json(name = "share_date") val share_date: String,
        @Json(name = "share_user") val share_user: String,
        @Json(name = "super_chapter_id") val super_chapter_id: Int,
        @Json(name = "super_chapter_name") val super_chapter_name: String,
        @Json(name = "tags") val tags: MutableList<Tag>,
        @Json(name = "title") val title: String,
        @Json(name = "item_type") val item_type: Int,
        @Json(name = "user_id") val user_id: Int,
        @Json(name = "visible") val visible: Int,
        @Json(name = "zan") val zan: Int,
        @Json(name = "top") var top: String
)

data class Tag(
        @Json(name = "name") val name: String,
        @Json(name = "url") val url: String
)

//首页-轮播图
data class Banner(
        @Json(name = "item_desc") val item_desc: String,
        @Json(name = "id") val id: Int,
        @Json(name = "image_path") val image_path: String,
        @Json(name = "is_visible") val is_visible: Int,
        @Json(name = "item_order") val item_order: Int,
        @Json(name = "title") val title: String,
        @Json(name = "item_type") val item_type: Int,
        @Json(name = "url") val url: String
)
data class Friend(
        @Json(name = "user_uuid") val user_uuid: String,
        @Json(name = "friend_uuid") val friend_uuid: String,
        @Json(name = "user_name") val user_name: String,
        @Json(name = "real_name") val real_name: String,
        @Json(name = "image_path") val image_path: String
)
data class HotKey(
        @Json(name = "id") val id: Int,
        @Json(name = "link") val link: String,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "visible") val visible: Int
)

/*
//常用网站
data class Friend(
        @Json(name = "icon") val icon: String,
        @Json(name = "id") val id: Int,
        @Json(name = "link") val link: String,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "visible") val visible: Int
)
*/

//知识体系
data class MeBody(
        @Json(name = "children") val children: MutableList<Discover>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "visible") val visible: Int
) : Serializable

//知识体系
data class DiscoverBody(
        @Json(name = "children") val children: MutableList<Discover>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "visible") val visible: Int
) : Serializable

data class Discover(
        @Json(name = "children") val children: List<Any>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "visible") val visible: Int
) : Serializable

data class Me(
        @Json(name = "children") val children: List<Any>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "visible") val visible: Int
) : Serializable

// 登录数据
data class LoginData(
        @Json(name = "my_uuid") val my_uuid: String,
        @Json(name = "user_name") val user_name: String,
        @Json(name = "nice_name") val nice_name: String,
        @Json(name = "real_name") val real_name: String,
        @Json(name = "sex") val sex: Int,
        @Json(name = "birth_day") val birth_day: String,
        @Json(name = "phone") val phone: String,
        @Json(name = "avatar_text") val avatar_text: String,
        @Json(name = "token") val token: String,
        @Json(name = "user_id") val user_id: String,
        @Json(name = "email") val email: String,
        @Json(name = "credit_score") val credit_score: Int,
        @Json(name = "area") val area: String,
        @Json(name = "address") val address: String,
        @Json(name = "is_explicit") val is_explicit: Int,
        @Json(name = "copper_cash") val copper_cash: Long,
        @Json(name = "gold_ingot") val gold_ingot: Long,
        @Json(name = "level_score") val level_score: Long
)

//收藏网站
data class CollectionWebsite(
        @Json(name = "desc") val desc: String,
        @Json(name = "icon") val icon: String,
        @Json(name = "id") val id: Int,
        @Json(name = "link") var link: String,
        @Json(name = "name") var name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "userId") val userId: Int,
        @Json(name = "visible") val visible: Int
)

data class CollectionArticle(
        @Json(name = "author") val author: String,
        @Json(name = "chapterId") val chapterId: Int,
        @Json(name = "chapterName") val chapterName: String,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "desc") val desc: String,
        @Json(name = "envelopePic") val envelopePic: String,
        @Json(name = "id") val id: Int,
        @Json(name = "link") val link: String,
        @Json(name = "niceDate") val niceDate: String,
        @Json(name = "origin") val origin: String,
        @Json(name = "originId") val originId: Int,
        @Json(name = "publishTime") val publishTime: Long,
        @Json(name = "title") val title: String,
        @Json(name = "userId") val userId: Int,
        @Json(name = "visible") val visible: Int,
        @Json(name = "zan") val zan: Int
)

// 导航
data class NavigationBean(
        val articles: MutableList<Article>,
        val cid: Int,
        val name: String
)

// 项目
data class ProjectTreeBean(
        @Json(name = "children") val children: List<Any>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "visible") val visible: Int
)

// 热门搜索
data class HotSearchBean(
        @Json(name = "id") val id: Int,
        @Json(name = "link") val link: String,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "visible") val visible: Int
)

// 搜索历史
data class SearchHistoryBean(val key: String) : LitePalSupport() {
    val id: Long = 0
}

// 公众号列表实体
data class WXChapterBean(
        @Json(name = "children") val children: MutableList<String>,
        @Json(name = "courseId") val courseId: Int,
        @Json(name = "id") val id: Int,
        @Json(name = "name") val name: String,
        @Json(name = "order") val order: Int,
        @Json(name = "parentChapterId") val parentChapterId: Int,
        @Json(name = "userControlSetTop") val userControlSetTop: Boolean,
        @Json(name = "visible") val visible: Int
)

// 用户个人信息
data class UserInfoBody(
        @Json(name = "coinCount") val coinCount: Int, // 总积分
        @Json(name = "rank") val rank: Int, // 当前排名
        @Json(name = "userId") val userId: Int,
        @Json(name = "username") val username: String
)

// 个人积分实体
data class UserScoreBean(
        @Json(name = "coinCount") val coinCount: Int,
        @Json(name = "date") val date: Long,
        @Json(name = "desc") val desc: String,
        @Json(name = "id") val id: Int,
        @Json(name = "reason") val reason: String,
        @Json(name = "type") val type: Int,
        @Json(name = "userId") val userId: Int,
        @Json(name = "userName") val userName: String
)

// 排行榜实体
data class CoinInfoBean(
        @Json(name = "coinCount") val coinCount: Int,
        @Json(name = "level") val level: Int,
        @Json(name = "rank") val rank: Int,
        @Json(name = "userId") val userId: Int,
        @Json(name = "username") val username: String
)

// 我的分享
data class ShareResponseBody(
        val coinInfo: CoinInfoBean,
        val shareArticles: ArticleResponseBody
)


